package com.fish;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        try{
            // 设置每次输入的延迟为200ms
            Thread.sleep(1000*5); // 休眠3秒
            Robot myRobot = new Robot();
            myRobot.setAutoDelay(700);
            // myRobot.keyPress(KeyEvent.VK_1);
            // myRobot.keyRelease(KeyEvent.VK_1);
            // Thread.sleep(1000*1); // 休眠1秒
            // myRobot.keyPress(KeyEvent.VK_ENTER);
            // myRobot.keyRelease(KeyEvent.VK_ENTER);

            
            // myRobot.keyPress(KeyEvent.VK_2);
            // myRobot.keyRelease(KeyEvent.VK_2);
            // Thread.sleep(1000*1); // 休眠1秒
            // myRobot.keyPress(KeyEvent.VK_ENTER);
            // myRobot.keyRelease(KeyEvent.VK_ENTER);
            
            // myRobot.keyPress(KeyEvent.VK_3);
            // myRobot.keyRelease(KeyEvent.VK_3);
            // Thread.sleep(1000*1); // 休眠1秒
            // myRobot.keyPress(KeyEvent.VK_ENTER);
            // myRobot.keyRelease(KeyEvent.VK_ENTER);

            Thread.sleep(1000*6);

            myRobot.mousePress(KeyEvent.BUTTON1_DOWN_MASK);		
            myRobot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK);	
            myRobot.mousePress(KeyEvent.BUTTON1_DOWN_MASK);		
            myRobot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK);	
            Thread.sleep(1000*2);
            //截图
            myRobot.keyPress(KeyEvent.VK_ESCAPE);
            myRobot.keyRelease(KeyEvent.VK_ESCAPE);
            Thread.sleep(1000*1);

            myRobot.keyPress(KeyEvent.VK_DOWN);
            myRobot.keyRelease(KeyEvent.VK_DOWN);
            Thread.sleep(500*1);
            
            myRobot.mousePress(KeyEvent.BUTTON1_DOWN_MASK);		
            myRobot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK);	
            myRobot.mousePress(KeyEvent.BUTTON1_DOWN_MASK);		
            myRobot.mouseRelease(KeyEvent.BUTTON1_DOWN_MASK);	
            Thread.sleep(1000*2);
            //截图
            myRobot.keyPress(KeyEvent.VK_ESCAPE);
            myRobot.keyRelease(KeyEvent.VK_ESCAPE);
            Thread.sleep(1000*1);

            myRobot.keyPress(KeyEvent.VK_DOWN);
            myRobot.keyRelease(KeyEvent.VK_DOWN);
            Thread.sleep(500*1);
            

            Thread.sleep(1000*2); 
            
            
            // 打出一个大写的Q
            // myRobot.keyPress(KeyEvent.VK_CAPS_LOCK);	// 模拟键盘按下shift键
            // Thread.sleep(1000*3); // 休眠3秒
            // myRobot.keyRelease(KeyEvent.VK_CAPS_LOCK);	// 模拟键盘释放shift键
            // Thread.sleep(1000*1); // 休眠3秒
            // myRobot.keyPress(KeyEvent.VK_SHIFT);	// 模拟键盘按下shift键
            // myRobot.keyRelease(KeyEvent.VK_SHIFT);	// 模拟键盘释放shift键
            // Thread.sleep(1000*1); // 休眠3秒
            // myRobot.keyPress(KeyEvent.VK_SHIFT);	// 模拟键盘按下shift键
            // myRobot.keyRelease(KeyEvent.VK_SHIFT);	// 模拟键盘释放shift键
            // Thread.sleep(1000*1); // 休眠3秒
            // myRobot.keyPress(KeyEvent.VK_SHIFT);	// 模拟键盘按下shift键
            // myRobot.keyRelease(KeyEvent.VK_SHIFT);	// 模拟键盘释放shift键
            // Thread.sleep(1000*1); // 休眠3秒
            // myRobot.keyPress(KeyEvent.VK_SHIFT);	// 模拟键盘按下shift键
            // myRobot.keyRelease(KeyEvent.VK_SHIFT);	// 模拟键盘释放shift键

            // myRobot.keyPress(KeyEvent.VK_Q);		// 模拟键盘按下Q键（小写）
            // myRobot.keyRelease(KeyEvent.VK_Q);		// 模拟键盘释放Q键
            // myRobot.keyRelease(KeyEvent.VK_SHIFT);	// 模拟键盘释放shift键


        } catch (AWTException e)
        {
            e.printStackTrace();
        }

        System.out.println("Hello world!");
    }
}